<template>
  <div class="messageInfo">
    <Form :model="message" :label-width="80">
      <FormItem label="标题">
        <Input type="text" v-model="message.title"></Input>
      </FormItem>
      <FormItem label="内容">
        <Input v-model="message.content" maxlength="200" show-word-limit type="textarea" />
      </FormItem>
      <FormItem label="发布人">
        <Input type="text" v-model="message.release"></Input>
      </FormItem>
      <FormItem label="发布时间">
        <DatePicker v-model="message.releaseTime" format="yyyy年MM月dd日" type="date"></DatePicker>
      </FormItem>
      <FormItem label="发布状态">
        <RadioGroup v-model="message.releaseState" type="button">
            <Radio :label="1">下发</Radio>
            <Radio :label="2">草稿</Radio>
        </RadioGroup>
      </FormItem>
    </Form>
  </div>
</template>

<script>
export default {
  props: {
    messageInfo: {
      type: Object,
      default: () =>{}
    }
  },
  data () {
    return {
      message: this.messageInfo
    };
  },
  created() {
    if (Object.keys(this.messageInfo).length == 0) {
      this.message.updateTime = new Date();
    }
    console.log(this.messageInfo,'this.messageInfo');
  },
  watch: {
  },
  methods: {

  }
};
</script>

<style>
</style>
